RPdirect(phi, boxcox, max_variab)
RPsequential(phi, boxcox, max_variables, back_steps, initial)
RMmodel
;
specifies the covariance model to be simulated.RFboxcox
for Details.
max_variab
, neither SVD nor Cholesky decomposition
are performed. If the given covariance structure has finite range and
use_spam != false
then spam is tried. It is important that this option is set
conveniently to avoid great losses of time during the internal
search of an appropriate method by RPgauss
.
Default: 8192
max
/ (number of spatial points).
Default: 10
.
back_steps
number of points are simulated. Then, sequentially,
all spatial points for the next time instance
are simulated at once, based on the previous back_steps
instances. The distribution of the first N points
is the correct distribution, but
differs, in general, from the distribution of the sequentially
simulated variables. We prefer here to have the same distribution
all over (although only approximatively the correct one),
hence do some initial sequential steps first.
If initial
is non-negative, then initial
first steps are performed.
If initial
is negative, then
back_steps
- initial
initial steps are performed. The latter ensures that
none of the very first N variables are returned.
Default: -10
.
RPsequential
returns an object of class RMmodel
RPdirect
is based on the well-known method for simulating
any multivariate Gaussian distribution, using the square root of the
covariance matrix. The method is pretty slow and limited to
about 8000 points, i.e. a 20x20x20 grid in three dimensions.
This implementation can use the Cholesky decomposition and
the singular value decomposition.
It allows for arbitrary points and arbitrary grids.
RPsequential
is programmed for spatio-temporal models
where the field is modelled sequentially in the time direction
conditioned on the previous $k$ instances.
For $k=5$ the method has its limits for about 1000 spatial
points. It is an approximative method. The larger $k$ the
better.
It also works for certain grids where the last dimension should
contain the highest number of grid points.
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
model <- RMgauss(var=10, s=10) + RMnugget(var=0.01)
plot(model, xlim=c(-25, 25))
z <- RFsimulate(model=RPdirect(model), 0:10, 0:10, n=4)
plot(z)
Run the code above in your browser using DataLab